<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/18
  Time: 9:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <title>后台管理系统</title>
    <base href="<%=basePath %>">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<link rel="stylesheet" href="layui/css/layui.css">
<script src="layui/layui.js"></script>
<script src="js/jquery.1.9.1.js"></script>
<style>
    .layui-tab-content{
        padding:0;
    }
    .show-frame{
        top:50px!important;
        overflow:hidden;
    }
    .frame{
        position: absolute;
        padding: 10px;
        width: 100%;
        height: 100%;
    }


</style>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">爱旅行网站后台</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>
            <li class="layui-nav-item"><a href="">商品管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    admin
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">商品管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" class="m1" id="1" title="商品分类" url="itemCat-list.jsp">商品分类</a></dd>
                        <dd><a href="javascript:;" class="m1" id="2" title="增加商品" url="item-add.jsp">增加商品</a></dd>
                        <dd><a href="javascript:;" class="m1" id="6" title="商品增加到索引库" url="solr-add.jsp">向索引库上导入商品</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">内容管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" class="m1" id="3" title="内容分类" url="contentCat-list.jsp">内容分类管理</a></dd>
                        <dd><a href="javascript:;" class="m1" id="4" title="内容管理" url="content-list.jsp">内容管理</a></dd>
                        <dd><a href="javascript:;" class="m1" id="5" title="增加内容" url="content-add.jsp">增加内容</a></dd>
                    </dl>
                </li>

            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="layui-tab"  lay-filter="main" lay-allowClose="true">
            <ul class="layui-tab-title">
                <li class="layui-this">后台管理首页</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">欢迎使用</div>

            </div>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © kgc.com - 后面管理系统
    </div>
</div>

<script type="text/javascript">
    //JavaScript代码区域
    layui.use('element', function(){
        var $=layui.jquery;
        var element = layui.element;

        $(".m1").click(function(){
            var id=$(this).attr("id");
            var title=$(this).attr("title");
            var url=$(this).attr("url");
            console.log(id+","+title+","+url);
            if($("li[lay-id="+id+"]").length==0)
                element.tabAdd('main', {
                    title: title
                    ,content: '<iframe src='+url+' class="frame" frameborder="0"></iframe>'
                    ,id: id
                });
            element.tabChange("main",id)
        });

    });
</script>
</body>
</html>
